package com.ihg.hiex.admin.web.controller.session.during;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.ihg.hiex.admin.entity.security.Login;
import com.ihg.hiex.admin.service.session.SessionMeetingService;
import com.ihg.hiex.admin.web.resolver.Secure;
import com.ihg.hiex.entity.session.meeting.SessionMeeting;

/**
 * 
 * @author dan
 *
 */
@Controller
@RequestMapping("/session-meetings")
public class SessionMeetingController {
    
    @Autowired
    private SessionMeetingService sessionMeetingService;
    
    /**
     * 
     * @param login
     * @return
     */
    @RequestMapping(path = "", method = RequestMethod.GET)
    public ModelAndView list(@Secure Login login) {
        
        ModelAndView modelAndView = new ModelAndView("session/during/session-meeting/session-meeting-list");
        
        List<SessionMeeting> sessionMeetings = sessionMeetingService.list(login.getId(), "Peer Calibration");
        modelAndView.addObject("sessionMeetings", sessionMeetings);
        
        return modelAndView;
    }

}
